#pragma once
#include "../Utility/Singleton.h"
#include "../Utility/Predeclare.h"
#include "../EngineSetting/EngineSetting.h"
#include <Windows.h>

//#ifdef PLATFORM_WIN_IMPLEMENT
//#define  NB_PLATFORM_API NB_API_EXPORT
//#else
//#define  NB_PLATFORM_API NB_API_IMPORT
//#endif

namespace EngineCore {

	class  PlatformWin : public  Singleton<PlatformWin>
	{
		friend class Singleton<PlatformWin>;
	public:
		typedef HMODULE HandleDLL;

		~PlatformWin();
		_hr SetUp(const EngineProperty&);
		bool HandleWindowsMessage(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
		
		_hr Launch();
		_hr Tick();
		
		
		HWND GetHwnd() { return m_hwnd;	}

		HandleDLL GetModule(const wchar_t* moduleName);
		void* GetMathod(HandleDLL& hMoudle,const char* procName);

		_hr FreeHandle(HandleDLL& hModule);
		
		static constexpr char* GetPlatformName() { return "WINDOWS"; } 


	protected:
		PlatformWin();
		HWND m_hwnd;
	};
}
